#ifndef _CONF_TIME_H_
#define _CONF_TIME_H_

#include <stdio.h>
#include <time.h>
#include "dictionary.h"
#include "iniparser.h"
#include <errno.h>
#include <sys/stat.h>
#include "network_info.h"

#define CONFIG_DIR_NAME "/etc/conf/"
#define CONFIG_INI_NAME "/etc/conf/config.ini"
#define STR_MAX_LENGTH (64)
#define ZONEINFO_DIR "/usr/share/zoneinfo"
#define LOCALTIME_PATH "/etc/localtime"
#define TIMEZONE_FILE "/etc/timezone"

typedef struct {
    int value;
    const char* tz_name;
    const char* gmt;
} TimeZoneEntry_S;

long int get_time_from_device();
int set_time_to_device();
int set_time_by_ntp(NetworkConfigNetworkNtpInfo *ntp_info);
int set_time_by_manaual(const char* datetime);

int save_time_info_to_ini(const NetworkConfigSystemTimeInfo *time_info);
int load_time_info_from_ini(NetworkConfigSystemTimeInfo *time_info);
int save_ntp_info_to_ini(const NetworkConfigNetworkNtpInfo *ntp_info);
int load_ntp_info_from_ini(NetworkConfigNetworkNtpInfo *ntp_info);
#endif